-
-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(enhanced): support shared module layers #3276
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # pnpm-lock.yaml
# Conflicts: # pnpm-lock.yaml
# Conflicts: # pnpm-lock.yaml
🦋 Changeset detectedLatest commit: ffdaf0b The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
Here is a concise summary of the changes in the pull request:
The key changes focus on enhancing the module sharing functionality in the enhanced
package by introducing support for module layers. This includes:
- Updating the
ConsumeSharedModule
andConsumeSharedPlugin
classes to handle layer-specific requests and module factorization, introducing new properties likelayer
,issuerLayer
, andrequiredLayer
. - Enhancing the
ConsumeSharedPlugin
class to manage layer-specific configurations and provide better support for layer-based module sharing. - Adding a new Jest command to the
package.json
file to run specific test cases for module layer support. - Implementing TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties.
These changes aim to improve the module sharing capabilities in the enhanced
package by providing more flexibility and control over how modules are consumed and shared, particularly in the context of layered module architectures.
File Summaries
File | Summary |
---|---|
packages/enhanced/src/declarations/plugins/sharing/ConsumeSharedModule.d.ts | Here is a short and concise technical summary of the changes: |
The code changes introduce support for module layers in the ConsumeSharedModule
and ConsumeSharedPlugin
classes. This includes adding new properties (layer
, issuerLayer
, requiredLayer
) to the ConsumeOptions
type to specify and resolve module layers. Additionally, the ConsumeSharedPlugin
class was updated to handle layer-specific requests and factorize modules based on the layer context. The changes also include updates to the package.json
file, such as adding a new Jest command and updating the webpack-cli
dependency, as well as adding TypeScript-based validation functions for the ConsumeSharedPlugin
schema. |
| packages/enhanced/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts | The changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
The
ConsumeSharedModule
andConsumeSharedPlugin
classes were updated to support module layers, allowing for more granular control over how modules are shared and consumed. New properties likelayer
,issuerLayer
, andrequiredLayer
were added to theConsumeOptions
type and the plugin options. -
The
ConsumeSharedPlugin
class was updated to handle layer-specific requests and factorize modules based on the layer context, improving the overall module sharing capabilities. -
The
package.json
file was updated to add a new Jest command for testing theConfigTestCases.basictest.js
file, and thewebpack-cli
dependency was updated to version^5.1.4
. -
TypeScript-based validation functions were added to the
ConsumeSharedPlugin.check.ts
file to ensure proper validation of the new properties introduced for module layer support. |
| packages/enhanced/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts | The key changes in this pull request are focused on enhancing the module sharing functionality in theenhanced
package. The main highlights are: -
Added support for specifying and resolving module layers in the
ConsumeSharedModule
andConsumeSharedPlugin
classes. This includes introducing new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and module factorization. -
Updated the
ConsumeSharedPlugin
class to manage layer-specific configurations and provide better support for layer-based module sharing. -
Added a new Jest command to the
package.json
file to run specific test cases for theConfigTestCases.basictest.js
file. -
Implemented TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties.
Overall, these changes aim to enhance the module sharing capabilities in the enhanced
package by introducing support for module layers, which is a key requirement for managing complex module dependencies and sharing scenarios. |
| packages/enhanced/src/declarations/plugins/sharing/SharePlugin.d.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
The
ConsumeSharedModule
andConsumeSharedPlugin
classes have been updated to support module layers, allowing for more granular control over module resolution and sharing. New properties likelayer
,issuerLayer
, andrequiredLayer
have been added to handle layer-specific requests and module factorization. -
The
package.json
file has been updated to include a new Jest command for running a specific test case, and thewebpack-cli
dependency has been updated to version^5.1.4
. -
TypeScript-based validation functions have been added to the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties.
These changes aim to improve the module sharing capabilities in the enhanced
package, providing more flexibility and control over how modules are consumed and shared across different layers or contexts. |
| packages/enhanced/src/lib/sharing/ConsumeSharedModule.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
- Updates to the
ConsumeSharedModule
andConsumeSharedPlugin
classes to support module layers, including the addition of new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and module factorization. - Addition of a new Jest command in the
package.json
file to run a specific test case for theConfigTestCases.basictest.js
file. - Updates to the schema validation for the
ConsumeSharedPlugin
to ensure proper validation of the new layer-related properties.
These changes aim to improve the module sharing capabilities by introducing support for module layers, which allows for more granular control and management of shared modules within the application. |
| packages/enhanced/src/lib/sharing/ConsumeSharedPlugin.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
The
ConsumeSharedModule
andConsumeSharedPlugin
classes have been updated to support module layers, allowing for more granular control over how modules are shared and consumed. This includes adding new properties likelayer
,issuerLayer
, andrequiredLayer
to theConsumeOptions
type and updating the corresponding logic in the plugin. -
The
package.json
file has been updated to add a new Jest command for testing theConfigTestCases.basictest.js
file, and thewebpack-cli
dependency has been updated to version^5.1.4
. -
The schema validation for the
ConsumeSharedPlugin
has been improved by adding TypeScript-based validation functions to ensure proper validation of the new layer-related properties.
Overall, these changes aim to enhance the module sharing capabilities of the enhanced
package, particularly by introducing support for module layers, which can help with more complex module management and sharing scenarios. |
| packages/enhanced/src/lib/sharing/ProvideSharedDependency.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
The
ConsumeSharedModule
andConsumeSharedPlugin
classes were updated to support module layers, allowing for more granular control over how modules are consumed and shared. This includes adding new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and module factorization. -
The
ProvideSharedDependency
class was updated to include a newlayer
property, which allows for specifying layer information when providing shared modules. -
The
package.json
file was updated to add a new Jest command for testing theConfigTestCases.basictest.js
file, and thewebpack-cli
dependency was updated to version^5.1.4
. -
TypeScript-based validation functions were added to the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties.
Overall, these changes aim to enhance the module sharing capabilities in the enhanced
package, particularly by introducing support for module layers and improving the related configuration and validation mechanisms. |
| packages/enhanced/src/lib/sharing/ProvideSharedModule.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
Updated the
ConsumeSharedModule
andConsumeSharedPlugin
classes to support module layers, allowing for more granular control over module consumption and sharing. This includes adding new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and module factorization. -
Added a new Jest command to the
package.json
file to run a specific test case for theConfigTestCases.basictest.js
file, and updated thewebpack-cli
dependency to version^5.1.4
. -
Implemented TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties.
The overall purpose of these changes is to enhance the module sharing capabilities in the enhanced
package, allowing for more flexible and granular control over module consumption and sharing, particularly in the context of module layers. |
| packages/enhanced/src/lib/sharing/ProvideSharedModuleFactory.ts | The code changes introduce several enhancements and fixes to the module sharing functionality in the enhanced
package. The key modifications include:
-
Adding support for specifying and resolving module layers in the
ConsumeSharedModule
andConsumeSharedPlugin
classes. This includes introducing new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and factorize modules based on the layer context. -
Updating the
package.json
file to add a new Jest command for running a specific test case and updating thewebpack-cli
dependency to version^5.1.4
. -
Implementing TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties.
The changes aim to enhance the module sharing functionality by introducing support for module layers, which allows for more granular control and management of shared modules within the application. |
| packages/enhanced/src/lib/sharing/ProvideSharedPlugin.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
Added support for specifying and resolving module layers in the
ConsumeSharedModule
andConsumeSharedPlugin
classes. This includes introducing new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and factorize modules based on the layer context. -
Updated the
ProvideSharedPlugin
class to handle layer-specific requests and create composite keys for module lookup based on the layer information. This allows for better management and resolution of shared modules across different layers. -
Added TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties. -
Updated the
package.json
file by adding a new Jest command to run specific test cases and bumping thewebpack-cli
dependency to version^5.1.4
.
The primary purpose of these changes is to enhance the module sharing capabilities in the enhanced
package, particularly by introducing support for module layers. This will allow for more granular control and management of shared modules, enabling better isolation and flexibility in the application's architecture. |
| packages/enhanced/src/lib/sharing/SharePlugin.ts | Here is a short and concise technical summary of the changes:
The code changes introduce support for module layers in the ConsumeSharedModule
and ConsumeSharedPlugin
classes. This includes adding new properties like layer
, issuerLayer
, and requiredLayer
to handle layer-specific module requests and factorize modules based on the layer context. Additionally, the package.json
file was updated to include a new Jest command for testing the ConfigTestCases.basictest.js
file, and TypeScript-based validation functions were added to ensure proper validation of the new properties in the ConsumeSharedPlugin
schema. |
| packages/enhanced/src/lib/sharing/ShareRuntimeModule.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
Updated the
ConsumeSharedModule
andConsumeSharedPlugin
classes to support module layers, allowing for more granular control over module sharing and consumption. This includes adding new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and module factorization. -
Added a new Jest command to the
package.json
file to run a specific test case for theConfigTestCases.basictest.js
file, along with an update to thewebpack-cli
dependency. -
Implemented TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties.
The overall purpose of these changes is to improve the module sharing capabilities within the enhanced
package, providing more flexibility and control over how modules are shared and consumed, particularly when dealing with module layers. |
| packages/enhanced/src/lib/sharing/resolveMatchedConfigs.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
Updated the
ConsumeSharedModule
andConsumeSharedPlugin
to support module layers, allowing for more granular control over module sharing and resolution. This includes adding new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and factorize modules based on the layer context. -
Added a new Jest command to the
package.json
file to run a specific test case for theConfigTestCases.basictest.js
file, and updated thewebpack-cli
dependency to version^5.1.4
. -
Implemented TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties.
The overall goal of these changes is to enhance the module sharing capabilities in the enhanced
package, providing more flexibility and control over how modules are shared and consumed across different layers or contexts. |
| packages/enhanced/src/lib/sharing/utils.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
The
ConsumeSharedModule
andConsumeSharedPlugin
classes have been updated to support module layers, allowing for more granular control over how modules are shared and consumed. This includes adding new properties likelayer
,issuerLayer
, andrequiredLayer
to theConsumeOptions
type and updating the corresponding logic in the classes. -
The
package.json
file has been updated to add a new Jest command for testing theConfigTestCases.basictest.js
file, and thewebpack-cli
dependency has been updated to version^5.1.4
. -
The
ConsumeSharedPlugin
schema validation has been enhanced with TypeScript-based validation functions to ensure proper validation of the new layer-related properties.
Overall, these changes aim to improve the module sharing capabilities in the enhanced
package, particularly by introducing support for module layers and updating the related tooling and validation. |
| packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.check.ts | The changes in this file focus on enhancing the schema validation for the ConsumeSharedPlugin
in the enhanced
package. The key modifications are:
- Added support for validating new properties related to module layers, such as
issuerLayer
,requiredLayer
, andlayer
. These properties are now checked for their existence and type (string) in the plugin options. - Expanded the validation to ensure that the
import
,packageName
,requiredVersion
,shareKey
,shareScope
, andlayer
properties are properly defined and meet the expected criteria (e.g., non-empty string). - Introduced additional checks to ensure that the
eager
andsingleton
properties are of the correct type (boolean). - Factored out the validation logic into separate functions (
r
,e
,t
,n
) to improve code organization and readability.
Overall, these changes aim to provide a more robust and comprehensive schema validation for the ConsumeSharedPlugin
, ensuring that the plugin options are properly configured and meet the expected requirements. |
| packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
The
ConsumeSharedModule
andConsumeSharedPlugin
classes have been updated to support module layers, allowing for more granular control over how modules are consumed and shared. This includes the addition of new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and module factorization. -
The
package.json
file has been updated to add a new Jest command for running a specific test case, and thewebpack-cli
dependency has been updated to version^5.1.4
. -
The schema validation for the
ConsumeSharedPlugin
has been improved by adding TypeScript-based validation functions to ensure proper validation of the new layer-related properties.
These changes aim to provide more flexibility and control over the module sharing functionality in the enhanced
package, allowing for better support of layered module architectures. |
| packages/enhanced/src/schemas/sharing/ProviderSharedPlugin.check.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
Added support for specifying and resolving module layers in the
ConsumeSharedModule
andConsumeSharedPlugin
classes. This includes new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and module factorization. -
Updated the
package.json
file by adding a new Jest command to run a specific test case and updating thewebpack-cli
dependency to version^5.1.4
. -
Implemented TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new layer-related properties.
The changes aim to enhance the module sharing functionality by introducing support for module layers, which allows for more granular control and management of shared modules within the application. |
| packages/enhanced/src/schemas/sharing/ProviderSharedPlugin.ts | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
-
Updated the
ConsumeSharedModule
andConsumeSharedPlugin
classes to support module layers, adding new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and factorize modules based on the layer context. -
Added a new Jest command to the
package.json
file to run a specific test case for theConfigTestCases.basictest.js
file, and updated thewebpack-cli
dependency to version^5.1.4
. -
Introduced TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new properties related to module layers. |
| packages/enhanced/test/configCases/sharing/layers-consume-loader/src/index.js | The code changes in this pull request focus on enhancing the module sharing functionality in theenhanced
package. The key modifications are: -
The
ConsumeSharedModule
andConsumeSharedPlugin
classes were updated to support module layers, allowing for more granular control over module sharing and resolution. This includes adding new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests. -
The
package.json
file was updated to add a new Jest command for testing theConfigTestCases.basictest.js
file, and thewebpack-cli
dependency was updated to version^5.1.4
. -
The
ConsumeSharedPlugin
schema validation was enhanced with TypeScript-based validation functions to ensure proper validation of the new layer-related properties.
These changes aim to improve the module sharing capabilities in the enhanced
package, particularly by introducing support for module layers and enhancing the related configuration and testing. |
| packages/enhanced/test/configCases/sharing/layers-provides-loader/src/index.js | The changes in this file introduce several enhancements and fixes to the module sharing functionality in the enhanced
package. The key modifications are:
- Added support for specifying and resolving module layers in the
ConsumeSharedModule
andConsumeSharedPlugin
classes, including new properties likelayer
,issuerLayer
, andrequiredLayer
. - Updated the
ConsumeSharedPlugin
class to handle layer-specific requests and factorize modules based on the layer context. - Added a new Jest command to the
package.json
file to run a specific test case, and updated thewebpack-cli
dependency. - Added TypeScript-based validation functions for the
ConsumeSharedPlugin
schema to ensure proper validation of the new properties.
The primary purpose of these changes is to enhance the module sharing capabilities of the enhanced
package, particularly by introducing support for module layers, which allows for more granular control and management of shared modules. |
| packages/enhanced/test/configCases/sharing/layers-share-plugin/src/index.js | The code changes in this pull request focus on enhancing the module sharing functionality in the enhanced
package. The key modifications are:
- Updates to the
ConsumeSharedModule
andConsumeSharedPlugin
classes to support module layers, including the addition of new properties likelayer
,issuerLayer
, andrequiredLayer
to handle layer-specific requests and module factorization. - Addition of a new Jest command in the
package.json
file to run a specific test case for theConfigTestCases.basictest.js
file. - Addition of TypeScript-based validation functions in the
ConsumeSharedPlugin.check.ts
file to ensure proper validation of the new properties introduced for module layer support.
The primary purpose of these changes is to extend the module sharing capabilities in the enhanced
package by introducing support for module layers, allowing for more granular control and management of shared modules across different layers or contexts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incremental Review
Comments posted: 11
Configuration
Squadron Mode: essential
Commits Reviewed
e26d10712d98c450b9ae57babdfab27dee9e1dad...24ef6d05e48f9cb5f128479f515714e50028e780
Files Reviewed
- packages/enhanced/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts
- packages/enhanced/src/declarations/plugins/sharing/SharePlugin.d.ts
- packages/enhanced/src/lib/sharing/ConsumeSharedModule.ts
- packages/enhanced/src/lib/sharing/ConsumeSharedPlugin.ts
- packages/enhanced/src/lib/sharing/SharePlugin.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- package.json
- packages/enhanced/test/configCases/sharing/layers-consume-entry/.gitignore
- packages/enhanced/test/configCases/sharing/layers-consume-entry/async-boundary.js
- packages/enhanced/test/configCases/sharing/layers-consume-entry/index-test.js
- packages/enhanced/test/configCases/sharing/layers-consume-entry/index.js
- packages/enhanced/test/configCases/sharing/layers-consume-entry/layer-exporter.js
- packages/enhanced/test/configCases/sharing/layers-consume-entry/node_modules/react/index.js
- packages/enhanced/test/configCases/sharing/layers-consume-entry/node_modules/react/index2.js
- packages/enhanced/test/configCases/sharing/layers-consume-entry/package.json
- packages/enhanced/test/configCases/sharing/layers-consume-entry/test.config.js
- packages/enhanced/test/configCases/sharing/layers-consume-entry/webpack.config.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/.gitignore
- packages/enhanced/test/configCases/sharing/layers-consume-loader/loaders/different-layer-loader.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/loaders/explicit-layer-loader.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/loaders/react-layer-loader.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/node_modules/react/index.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/node_modules/react/index2.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/package.json
- packages/enhanced/test/configCases/sharing/layers-consume-loader/shared/react-boundary.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/test.config.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/tests/different-layers.test.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/tests/layer-inheritance.test.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/tests/unlayered-share.test.js
- packages/enhanced/test/configCases/sharing/layers-consume-loader/webpack.config.js
- pnpm-lock.yaml
e6d565c
to
b8df73e
Compare
# Conflicts: # pnpm-lock.yaml
# Conflicts: # pnpm-lock.yaml
72d6a5f
to
dfab802
Compare
dfab802
to
81d2365
Compare
# Conflicts: # .cursorignore # packages/runtime-core/src/core.md # pnpm-lock.yaml
Description
This pull request enhances the module sharing functionality in the
enhanced
package by implementing comprehensive layer support and improving schema validation. The changes focus on the compiler mechanics for module layers, with runtime updates planned for a future PR.Key Changes
Schema Validation Enhancements
ConsumeSharedPlugin
schemaProvideSharedPlugin
schema with layer supportModule Resolution Improvements
Share Configuration Updates
normalizeConsumeShareOptions
Example Configuration
Technical Implementation Details
utils.ts
]: Enhanced module resolution with layer supportConsumeSharedPlugin.check.ts
]: Added comprehensive schema validationProviderSharedPlugin.ts
]: Updated schema with layer propertiesNote
This PR focuses on the compiler mechanics for module layers. Runtime module aspects will be updated in a subsequent PR.
Types of changes
Checklist